package com.auxgroup.smarthome.inner.controller;

import com.auxgroup.smarthome.inner.service.BaseCodesDBService;
import com.auxgroup.smarthome.inner.vo.BaseCodesVo;
import com.auxgroup.smarthome.web.ApiResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by root on 17-7-25.
 */
@Api(description = "基础字典", tags = "获取base_codes")
@RestController
public class BaseCodesController {

    @Autowired
    BaseCodesDBService baseCodesDBService;

    @ApiOperation(value = "获取基础字典",notes = "")
    //@ApiImplicitParam(name = "typeCode", value = "代码类型", required = true, paramType = "form", dataType = "string")
    @RequestMapping(value = "/baseCodes/{typeCode}", method = RequestMethod.GET)
        public ApiResponse<List<BaseCodesVo>> getBaseCodes(@PathVariable String typeCode){
        return ApiResponse.ok(baseCodesDBService.findBaseCodes(typeCode));
    }
}
